package generic;

import java.util.ArrayList;
import java.util.Collection;

public class GenericDemo03 {
    public static void main(String[] args) {
        //Collection c = new ArrayList();
        Collection<String> c = new ArrayList<String>();
        c.add("abc");
        c.add("def");
        //c.add(123);add的形参已经被确定成String类型

        Collection c2 = new ArrayList<String>();//这种写法泛型仍然未指定类型
        //c2.add()这里add的形参仍然为Object

    }
}
